﻿<UserControl x:Class="Shammateh.Win.UI.Views.Operation.AudienceOperationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:xoqalControls="clr-namespace:Xoqal.Presentation.Controls;assembly=Xoqal.Presentation"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <GroupBox Grid.Row="1" Header="" IsEnabled="{Binding IsInEditMode}" xoqalControls:ValidationHelper.ValidationController="{Binding ValidationController}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                
                <TextBlock Margin="2">نام:</TextBlock>
                <TextBox Grid.Column="1" Margin="2" Text="{Binding CurrentItem.FirstName, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>

                <TextBlock Grid.Row="1" Margin="2">نام خانوادگی:</TextBlock>
                <TextBox Grid.Row="1" Margin="2" Grid.Column="1" Text="{Binding CurrentItem.LastName, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>

                <TextBlock Grid.Row="2" Margin="2">پست الکترونیکی:</TextBlock>
                <TextBox Grid.Row="2" Margin="2" Grid.Column="1" FlowDirection="LeftToRight" Text="{Binding CurrentItem.Email, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
                
                <TextBlock Grid.Row="3" Margin="2">توضیح:</TextBlock>
                <TextBox Grid.Row="3" Margin="2" Grid.Column="1" Text="{Binding CurrentItem.Comment, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>

                <StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,5,5" Grid.ColumnSpan="2">
                    <Button Command="{Binding AcceptChangesCommand}" Style="{StaticResource acceptButton}" />
                    <Button Command="{Binding CancelChangesCommand}" Style="{StaticResource cancelButton}" />
                </StackPanel>
            </Grid>
        </GroupBox>
    </Grid>
</UserControl>
